# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=freecell-solver
pkgver=4.20.0
pkgrel=2
pkgdesc="A program that automatically solves layouts of Freecell and similar variants of Card Solitaire"
arch=(x86_64)
url="http://fc-solve.shlomifish.org"
license=(MIT)
depends=(bash)
makedepends=(cmake gperf perl-path-tiny perl-template-toolkit python-random2 python-six)
optdepends=('python-random2: for the Python scripts' 'python-six: for the Python scripts')
source=(http://fc-solve.shlomifish.org/downloads/fc-solve/$pkgname-$pkgver.tar.xz)
sha256sums=('869c210e7b63b0e0dcfb1c4a2322c41cfa8fbf8db01e7722254a7425a1ab7f81')

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DFCS_WITH_TEST_SUITE=OFF \
    -DBUILD_STATIC_LIBRARY=OFF
  make -j1
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
  install -Dm644 "$srcdir"/$pkgname-$pkgver/COPYING.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
